<?php require 'login.php';
if(isset($_POST['magv']))$magv=$_POST['magv'];
if(isset($_POST['nienkhoa']))$nienkhoa=$_POST['nienkhoa'];
?>
<div id="trongkhung1"><p></p></div>
<div id="xoakhht"><p></p></div>

<p><span class="level_1_1" style="border:none"><a href="./He thong quan ly - Truong Dai hoc Can Tho_files/He thong quan ly - Truong Dai hoc Can Tho.htm">Giảng viên tổ chức hội thao: </a></span>
    <div id="divDMHP">
    <?php if(isset($_POST['login']))$login=$_POST['login'];?>
	<?php if($login){ ?>
	<hr>
	<form  method="post" class="form-horizontal">
		<div id="dschon">
		<div class="form-group">
		<label for="ChonNK" class="col-sm-2 control-label">Chọn niên khóa: </label> 
		<div class="col-sm-2">
		
		<select name="ChonNK"  id="ChonNK" class="form-control">	
	<?php
	$sql = "SELECT distinct NienKhoa FROM dbo_nienkhoa ORDER BY NienKhoa";
	$result = $db->query ( $sql );
	if ($result) {
		while ( $row = $result->fetch () ) {
			echo "<option value='" . $row ["NienKhoa"] . "'";
			if ($row ["NienKhoa"] == $nienkhoa) {
				echo " selected ";
			}
			echo ">";
			echo $row ["NienKhoa"] . "</option>";
		}
	}
	?>
		</select>
		</div>
		
		
		<div class="col-sm-1">
      					<button  class="form-control" id="btnSubmitKHHT" value="show">
      						<span class="glyphicon glyphicon-circle-arrow-right"></span>
      					</button>
      					<input type ="hidden" name="idmssv" id='idmssv' value ="<?php echo $UserDN?>"/>
		  </div>	
			
		  </div>
	  </div>
	  </form>
			<div id="divKHHT">
			 <?php

$sql="SELECT dbo_monhoc.MaMH, TenMH, NienKhoa FROM dbo_kehoachhoithao, dbo_monhoc ";
$sql.=" WHERE dbo_kehoachhoithao.MaMH=dbo_monhoc.MaMH and NienKhoa=:nk ";
$stmt = $db->prepare($sql);
$stmt->bindParam(":nk",$nienkhoa,PDO::PARAM_STR);
$stmt->execute();


$sql3="SELECT dbo_giangvien.MaGV,Holot, Ten FROM dbo_giangvien WHERE dbo_giangvien.MaGV=:magv";
$stmt2 = $db->prepare($sql3);
$stmt2->bindParam(":magv",$magv,PDO::PARAM_STR);
$stmt2->execute();
$r3=$stmt2->fetch();


$sql4="SELECT dbo_noidung.MANHOM,dbo_noidung.TENNHOM, dbo_monhoc.TenMH FROM dbo_noidung, dbo_kehoachnoidung, dbo_monhoc  ";
$sql4.=" WHERE dbo_kehoachnoidung.MANHOM=dbo_noidung.MANHOM and dbo_kehoachnoidung.MAMH=dbo_monhoc.MAMH ";
$stmt3 = $db->prepare($sql4);
$stmt3->execute();
?>
<hr ></hr>

<table  class="table table-bordered table-hover" style="font-size: 13px;">
	
			<thead>
	  <div class="row">
				<div class="col-md-12 text-center">
				<p class="form-group alert-info"><label>MSGV :</label><span><?php echo $r3['MaGV'];?></span> <label><?php echo "  -  "?>Họ và tên :</label><span><?php echo $r3['Holot']." ".$r3['Ten'];?></span>
			</p> </div></div>
			<tr class="info"><th>STT</th><th>Mã môn thi</th><th>Tên môn thi</th><th>Năm học</th><th>Chi tiết môn thi</th><th>Xóa</th></tr></thead>
			<tbody>
	<?php $i=1;
	
		if($stmt->execute()){		
				while($r=$stmt->fetch()){
?>
				<tr>
					<td><?php echo $i++;?></td>
					<td><?php echo $r['MaMH'];?></td>
					<td><?php echo $r['TenMH'];?></td>
					<td><?php echo $r['NienKhoa'];?></td>
					<td><?php echo"<input type='radio' name='rdDKNoidung' id='rdDKNoidung' value='".$r['MaMH']."'  title='Nhấp chuột vào đây để xem thông tin chi tiết của môn thể thao thi đấu.'>";
					?>	</td>
					
	
	<td><a class="del" id="btnxoakhht" href='#' data-mamon="<?php echo $r['MaMH'];?>" data-tenmon="<?php echo $r['TenMH'];?>" ><span class="glyphicon glyphicon-trash"></span></a></td>
		<?php }} ?>	
			</tbody>
			</table>
		 </div>
		 <hr>
		 <form  method="post" class="form-horizontal">
		<div class="form-group">
		
		<div class="col-sm-4"><button class="form-control btn btn-primary btn-xs" id="btnSubmitNgoaiKhung" value="show">
      					Học phần ngoài khung CTDT</button>
		</div>
      					<input type ="hidden" name="idmsgv" id='idmsgv' value ="<?php echo $UserDN?>"/>
		  </div>	
			
		   </div>
	  </form>
	  
	  
	  
	  
	  
	  
	  
	  
	  
	  
	  <hr ></hr>

<table  class="table table-bordered table-hover" style="font-size: 13px;">
	
			<thead>
	  <div class="row">
				<div class="col-md-12 text-center">
				<p class="form-group alert-info"><label>Danh sách chi tiết môn thể thao</label>
			</p> </div></div>
			<tr class="info">
	  	<th>STT</th>  
        <th>Môn thể thao </th>
        <th>Nội dung thi đấu </th>
		<th>Xóa</th>
      </tr>
    </thead>
    <tbody>
	<?php $i=1;
		if($stmt3->execute()){		
				while($r=$stmt3->fetch()){
?>
				<tr>
					<td><?php echo $i++;?></td>
					<td><?php echo $r['TenMH'];?></td>
					<td><?php echo $r['TENNHOM'];?></td>
					<td><a class="del" id="btnxoanoidung" href='#' data-manhom="<?php echo $r['MANHOM'];?>" data-tenmon="<?php echo $r['TenMH'];?>" ><span class="glyphicon glyphicon-trash"></span></a></td>

      </tr>
	  <?php }} ?>	
    </tbody>
    <tfoot>
      <tr>
      </tr>
    </tfoot>
  </table>		 
  </div>
		 <hr>
		
		<?php }else{ 	header("location: index.php");}?>
</div>
    </p>